table.insert(itemActions,
	function(item, action)
		-- UNIQUE jewels
		if not (item.quality == ItemQuality.Unique and
				item.baseItem.code == "jew") then
			return false
		end

		return processItemList(item, action, uniqueJewels)
	end
)

-- see: dir .. "readme.txt" for information regarding itemLists

uniqueJewels = {
	{"jew", 8, true, -- Facets
		function(item)
			if item.flags.Identified then
				return isGoodFacet(item) -- see below
			end
			
			return true -- unid
		end
	}
}

function isGoodFacet(item) -- only keeps any 5/5
	local fire, cold, light, psn = false, false, false, false

	if (findStat(item, "Passive Fire Mastery") >= 3 and
			findStat(item, "Passive Fire Pierce") >= 3) then
		fire = true
	elseif (findStat(item, "Passive Cold Mastery") >= 3 and
			findStat(item, "Passive Cold Pierce") >= 3) then
		cold = true
	elseif (findStat(item, "Passive Lightning Mastery") >= 3 and
			findStat(item, "Passive Lightning Pierce") >= 3) then
		light = true
	elseif (findStat(item, "Passive Poison Mastery") >= 3 and
			findStat(item, "Passive Poison Pierce") >= 3) then
		psn = true
	end

	return (fire or cold or light or psn)
end
